import type { App } from 'vue';
// import { Icon } from './Icon';
// import { Button } from './Button';
// import {
//   // Need
//   Button as AntButton,
//   Affix,
//   Anchor,
//   AutoComplete,
//   Alert,
//   Avatar,
//   BackTop,
//   Badge,
//   Breadcrumb,
//   Calendar,
//   Card,
//   Collapse,
//   Carousel,
//   Cascader,
//   Checkbox,
//   Col,
//   DatePicker,
//   Divider,
//   Dropdown,
//   Form,
//   Input,
//   InputNumber,
//   Layout,
//   List,
//   LocaleProvider,
//   Menu,
//   Mentions,
//   Modal,
//   Pagination,
//   Popconfirm,
//   Popover,
//   Progress,
//   Radio,
//   Rate,
//   Row,
//   Select,
//   Slider,
//   Spin,
//   Statistic,
//   Steps,
//   Switch,
//   Table,
//   Transfer,
//   Tree,
//   TreeSelect,
//   Tabs,
//   Tag,
//   TimePicker,
//   Timeline,
//   Tooltip,
//   Upload,
//   Drawer,
//   Skeleton,
//   Comment,
//   ConfigProvider,
//   Empty,
//   Result,
//   Descriptions,
//   PageHeader,
//   Space,
//   Image,
//   message,
// } from 'ant-design-vue';

import Antd from 'ant-design-vue';

// import ElementPlus from 'element-plus';

import { VueClipboard } from '@soerenmartius/vue3-clipboard'

import { Icon } from './Icon';

import coreStyle from '/@/tool/coreStyle';

import { toParam } from '/@/tool/Param';

import coreTool from '/@/tool/coreTool';

import { getTreeTkeys } from '/@/tool/coreTool';

import Dict from './CoreComp/Dict.vue';
import FileUpload from './CoreComp/FileUpload.vue';
import FileSelect from './CoreComp/FileSelect.vue';
import DateYear from './CoreComp/DateYear.vue';
import DateMonth from './CoreComp/DateMonth.vue';
import DateDay from './CoreComp/DateDay.vue';
import DateTime from './CoreComp/DateTime.vue';
import DateDayRange from './CoreComp/DateDayRange.vue';
import DateTimeRange from './CoreComp/DateTimeRange.vue';
import DateUnixTime from './CoreComp/DateUnixTime.vue';
import DateUnixTimeRange from './CoreComp/DateUnixTimeRange.vue';
import SwitchPostLogin from './CoreComp/SwitchPostLogin.vue';
import ActProcessEditor from './CoreComp/ActProcessEditor/ActProcessEditor.vue';
import CodeEditor from './CoreComp/CodeEditor/CodeEditor.vue';
import CodeEditorXml from './CoreComp/CodeEditorXml/CodeEditorXml.vue';
import CodeEditorSql from './CoreComp/CodeEditorSql/CodeEditorSql.vue';
import CodeEditorJson from './CoreComp/CodeEditorJson/CodeEditorJson.vue';

// const compList = [AntButton.Group];

export function registerGlobComp(app: App) {
  // compList.forEach((comp) => {
  //   app.component(comp.name || comp.displayName, comp);
  // });

  // app.use(ElementPlus);
  app.use(Antd);

  app.use(VueClipboard);

  app.component('CoreIcon', Icon);
  app.component('Dict', Dict);
  app.component('FileUpload', FileUpload);
  app.component('FileSelect', FileSelect);
  app.component('DateYear', DateYear);
  app.component('DateMonth', DateMonth);
  app.component('DateDay', DateDay);
  app.component('DateTime', DateTime);
  app.component('DateDayRange', DateDayRange);
  app.component('DateTimeRange', DateTimeRange);
  app.component('DateUnixTime', DateUnixTime);
  app.component('DateUnixTimeRange', DateUnixTimeRange);
  app.component('SwitchPostLogin', SwitchPostLogin);
  app.component('ActProcessEditor', ActProcessEditor);
  app.component('CodeEditor', CodeEditor);
  app.component('CodeEditorXml', CodeEditorXml);
  app.component('CodeEditorSql', CodeEditorSql);
  app.component('CodeEditorJson', CodeEditorJson);

  // app
  //   .use(Button)
  //   .use(Affix)
  //   .use(Anchor)
  //   .use(AutoComplete)
  //   .use(Alert)
  //   .use(Avatar)
  //   .use(BackTop)
  //   .use(Badge)
  //   .use(Breadcrumb)
  //   .use(Calendar)
  //   .use(Card)
  //   .use(Collapse)
  //   .use(Carousel)
  //   .use(Cascader)
  //   .use(Checkbox)
  //   .use(Col)
  //   .use(DatePicker)
  //   .use(Divider)
  //   .use(Dropdown)
  //   .use(Form)
  //   .use(Input)
  //   .use(InputNumber)
  //   .use(Layout)
  //   .use(List)
  //   .use(LocaleProvider)
  //   .use(Menu)
  //   .use(Mentions)
  //   .use(Modal)
  //   .use(Pagination)
  //   .use(Popconfirm)
  //   .use(Popover)
  //   .use(Progress)
  //   .use(Radio)
  //   .use(Rate)
  //   .use(Row)
  //   .use(Select)
  //   .use(Slider)
  //   .use(Spin)
  //   .use(Statistic)
  //   .use(Steps)
  //   .use(Switch)
  //   .use(Table)
  //   .use(Transfer)
  //   .use(Tree)
  //   .use(TreeSelect)
  //   .use(Tabs)
  //   .use(Tag)
  //   .use(TimePicker)
  //   .use(Timeline)
  //   .use(Tooltip)
  //   .use(Upload)
  //   .use(Drawer)
  //   .use(Skeleton)
  //   .use(Comment)
  //   .use(ConfigProvider)
  //   .use(Empty)
  //   .use(Result)
  //   .use(Descriptions)
  //   .use(PageHeader)
  //   .use(Space)
  //   .use(Image);
  // app.config.globalProperties.$message = message;
  app.config.globalProperties.coreStyle = coreStyle;
  app.config.globalProperties.$toParam = toParam;
  app.config.globalProperties.$getUUID36 = coreTool.getUUID36;
  app.config.globalProperties.$getUUID32 = coreTool.getUUID32;
  app.config.globalProperties.$copyProperties = coreTool.copyProperties;
  app.config.globalProperties.$toSearch = coreTool.toSearch;
  app.config.globalProperties.$getTreeTkeys = getTreeTkeys;
}
